// 带参数装饰器
function FirstClassDecorator(params?: any) {
  console.log("params", params);
  return function (targetClass: { new (...args: any[]): any }) {
    // targetClass表示的就是CustomerService本身
    let targetClassObj = new targetClass();
    targetClassObj.buy();
    console.log("targetClass.n:", targetClass.name);
  };
}

@FirstClassDecorator("我是用来修饰CustomerService类的装饰器代码")
class CustomerService {
  name: string = "下单";
  constructor() {}
  buy() {
    console.log(this.name + "购买");
  }
  placeOrder() {
    console.log(this.name + "下单购买");
  }
}

export {};
